<script lang="ts">
export default {
  name: 'Test-test1-2'
}
</script>

<template>
  <h2>表单输入展示 - 测试使用 reactive 来管理多个表单字段的数据绑定和响应式展示。</h2>
  <div class="test">
    <div class="form-container">
      <h2>Enter your information</h2>
      <label for="name">Name:</label>
      <input type="text" id="name" v-model="userInfo.name" />

      <label for="age">Age:</label>
      <input type="number" id="age" v-model="userInfo.age" />

      <p>Your name is {{ userInfo.name }} and you are {{ userInfo.age }} years old.</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue'

interface IuserInfo {
  name?: string
  age?: number
}
const userInfo = reactive<IuserInfo>({})
</script>

<style scoped>
.form-container {
  margin: 20px;
}

input {
  display: block;
  margin: 10px 0;
  padding: 5px;
}

label {
  font-weight: bold;
}

p {
  margin-top: 20px;
  font-size: 1.2em;
}

body {
  padding: 20px;
}
h2 {
  color: red;
}
h3 {
  color: rgb(220, 85, 85);
}
h4 {
  color: skyblue;
}
.hr-style {
  border: 3px solid gold;
  margin: 20px 0;
}
.group {
  border: 4px solid rgb(102, 215, 85);
  margin: 10px;
  padding: 10px;
}
.group3 {
  border: 2px solid rgb(64, 163, 199);
  margin: 10px;
  padding: 10px;
}
.note {
  margin: 10px;
  padding: 10px;
  border: 3px solid rgb(221, 121, 202);
}
/* .note p {
color: rgb(226, 106, 204);
font-weight: bold;
} */
</style>
